// OSCClass Simple Send processing test sketch
// OSCClass version 1.0.1(Arduino ver0014)
// need oscP5 Library
// Copyright (c) recotana(http://recotana.com).  All right reserved.
 
import oscP5.*;
import netP5.*;

OscP5 oscP5;


void setup() {
  size(400,400);
  frameRate(25);

  oscP5 = new OscP5(this,10000);
  
}


void draw() {
  background(0);  
}


void oscEvent(OscMessage oscMessage) {

  print("received!");
  print(" addrpattern: "+oscMessage.addrPattern());
  String typeTag = oscMessage.typetag();
  print(" typetag: "+typeTag);
  print(" ");
  
  for(int i=0 ; i<typeTag.length() ; i++){

   switch( typeTag.charAt(i) ){
     
    case 'i': print( oscMessage.get(i).intValue() );
      break;

    case 'f': print( oscMessage.get(i).floatValue() );
      break;
 
    case 's': print( oscMessage.get(i).stringValue() );
      break;     
     
   }
  
    print(" ");
  }
  println("");
  
}
